<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8" session="false" %>
	
	<%@page import="com.eos.data.datacontext.DataContextManager"%>
	<%@page import="com.primeton.cap.AppUserManager"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- 
  - Author(s): zengjunjie
  - Date: 2018-05-29 15:49:47
  - Description:
-->
<head>
<title>人资行政管理平台</title>
<%@include file="/common/common.jsp"%>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
   <link rel="stylesheet" type="text/css" href="<%= request.getContextPath() %>/coframe/auth/skin2/css/bootsnav.css">
	<link rel="stylesheet" type="text/css" href="<%= request.getContextPath() %>/coframe/auth/skin2/css/htmleaf-demo.css">
   <%
   
  	 String empname = DataContextManager.current().getMUODataContext().getUserObject().getUserRealName();
		String empid = DataContextManager.current().getMUODataContext().getUserObject().getUserId();
   
    %>
   
   <style type="text/css">
		.navbar-brand{
		    padding: 29px 15px;
		    height: auto;
		}
		nav.navbar.bootsnav{
		    border: none;
		}
		.navbar-nav{
		    float: left;
		}
		nav.navbar.bootsnav ul.nav > li > a{
		    color: #474747;
		    text-transform: uppercase;
		    padding: 30px 20px;
		    font-weight: 100!important;
		        font-size: 16px;
		}
		nav.navbar.bootsnav ul.nav > li:hover{
		    background: #f4f4f4;
		}
		.nav > li:after{
		    content: "";
		    width: 0;
		    height: 5px;
		    background: #34c9dd;
		    position: absolute;
		    bottom: 0;
		    left: 0;
		    transition: all 0.5s ease 0s;
		}
		.nav > li:hover:after{
		    width: 100%;
		}
		nav.navbar.bootsnav ul.nav > li.dropdown > a.dropdown-toggle:after{
		    content: "+";
		    font-family: 'FontAwesome';
		    font-size: 16px;
		    position: absolute;
		    top: 35%;
		    transition: all 0.4s ease 0s;
		}
		nav.navbar.bootsnav ul.nav > li.dropdown.on > a.dropdown-toggle:after{
		    content: "+";
		    transform: rotate(90deg);
		}
		.dropdown-menu.multi-dropdown{
		    position: absolute;
		    left: -100% !important;
		}
		nav.navbar.bootsnav li.dropdown ul.dropdown-menu{
		    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
		    border: none;
		    width: 0px!important;
		}
		@media only screen and (max-width:990px){
		    nav.navbar.bootsnav ul.nav > li.dropdown > a.dropdown-toggle:after,
		    nav.navbar.bootsnav ul.nav > li.dropdown.on > a.dropdown-toggle:after{ content: " "; }
		    .dropdown-menu.multi-dropdown{ left: 0 !important; }
		    nav.navbar.bootsnav ul.nav > li:hover{ background: transparent; }
		    nav.navbar.bootsnav ul.nav > li > a{ margin: 0; }
		}
		html, body,.demo{
			height: 100%;
		}
		.container{
			width: 85%;
			margin-left: initial;
			float: left;
		}
		.user{
			float: right;
			width: 15%;
			padding-top: 30px;
			padding-bottom: 20px;
		}
		.user .name,.user span a{
			font-size: 14px;
			color: #000;
		}
		.user span a:HOVER {
			text-decoration: underline;
		}
		#mainField{
			padding-right: 20px;
    		padding-left: 20px;
    		z-index:-1;float: left;width: 100%;height: 550px;
		}
		.container,.navbar{
			background-color: #f3f3f3;
		}
		.navbar-collapse{
			padding-right: 0px!important;
    		padding-left: 0px!important;
		}
		.login-out img{
	    	margin-top: -4px;
    margin-right: 2px;
	    }
	</style> 
</head>
<body>
<div class="demo">
		<div style="box-shadow: 0px 5px 5px #E2E2E2;margin-bottom: 15px;float: left;width: 100%;background-color: #f3f3f3;">
	        <div class="container">
	            <div class="row">
	                <div class="col-md-12">
	                    <nav class="navbar navbar-default navbar-mobile bootsnav" style="background-color: #f3f3f3;">
	                        <div class="navbar-header">
	                            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar-menu">
	                                <i class="fa fa-bars"></i>
	                            </button>
	                        </div>
	                        <div class="collapse navbar-collapse" id="navbar-menu">
	                            <ul class="nav navbar-nav" data-in="fadeInDown" data-out="fadeOutUp">
	                               
	                            </ul>
	                        </div>
	                    </nav>
	                </div>
	            </div>
	        </div>
	        
	       <div class="user">
	        	<%-- <span class="name">您好！<%=empname %></span> --%>
	        	<span style="float: right;padding-right: 33px;"> 
					<a class="login-out" href="<%= request.getContextPath() %>/coframe/auth/login/logout.jsp" target="_top">
					<img src="<%= request.getContextPath() %>/coframe/auth/skin2/images/exit.png">退出</a>
				</span>
				<span style="float: right;padding-right: 33px;">
					<a class="return-index" href="<%= request.getContextPath() %>/coframe/auth/login/index.jsp" target="_top">
					<%-- <img src="<%= request.getContextPath() %>/coframe/auth/skin2/images/exit.png"> --%>平台首页</a>
				</span>
	        </div>
	       </div> 
	        <div class="h-main" id="mainField">
					<iframe id="mainframe" src="<%-- <%= request.getContextPath() %>/coframe/rights/user/user_list.jsp --%>" frameborder="0" name="main" style="width:100%;height:100%;"></iframe>
			</div>
</div>


	<script type="text/javascript">
	//主内容区
	var iframe = document.getElementById("mainframe");
	
	$(function(){
		getMenuData();//获取菜单数据
		
		$("#7").parent().css('background-color','#d9d9d9');
		//监听<a>标签点击事件，如果有url，则在主内容区展现url,如果有jspUrl，则跳转到该url界面
		$(".navbar-nav a").click(function(){
	    	if($(this).attr("url")){
		    	var url = $(this).attr("url") ? $(this).attr("url") : "";
		    	setIFrame(url);
		    	$(".navbar-nav a").parent().css('background-color','#f3f3f3');
		    	$(this).parent().css('background-color','#d9d9d9');
	        	document.getElementById("mainField").style.zIndex = "1";
	    	}
	    });
	    
	    //模拟点击A（第一个有链接的A标签）
	    var firstA = $("#navbar-menu a[url!=null]:first");
	    if(firstA && firstA.attr("url") != "null"){
	    	firstA.click();
	    }
	});
	//在iframe中展现相应页面
	function setIFrame(url){
		var relative = url.substr(0,1);
		if(relative == "/"){
			url = "<%= request.getContextPath() %>" + url;
		}
		iframe.src = url;
	}
	
	
   	//获取菜单数据
	function getMenuData(){
		var appCode = "<%=request.getParameter("appCode") == null ? "1" : request.getParameter("appCode")%>";
		var json = {
			appCode : appCode,
			status : (appCode != "coframe" ? "true" : "false")
		};
		var jsonStr = JSON.stringify(json);
		$.ajax({
			url: "org.gocom.components.coframe.auth.LoginManager.getMenuData.biz.ext",
			type: "POST",
			data:jsonStr,
			contentType:"text/json",
			async:false,
			success: function(text){
				var treeNodes = text.treeNodes;
				var html="";
				$(treeNodes).each(function(i,obj){//遍历第一层菜单
					if(obj.childrenMenuTreeNodeList==null){//判断是否存在第二层
						
					}else{
						$(obj.childrenMenuTreeNodeList).each(function(j,obj2){//遍历第二层菜单
							if(obj2.childrenMenuTreeNodeList==null){//判断是否存在第三层
								html+='<li><a href="#" url="'+obj2.linkAction+'" id="'+obj2.menuPrimeKey+'" menuseq="'+obj2.menuSeq+'">'+obj2.menuName+'</a>';
									
								html+='</li>';
							}else{
								html+='<li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown" url="'+obj.linkAction+'" id="'+obj.menuPrimeKey+'" menuseq="'+obj.menuSeq+'">'+obj2.menuName+'</a>';
								html+='<ul class="dropdown-menu animated">';
									$(obj2.childrenMenuTreeNodeList).each(function(k,obj3){//遍历第三层
										if(obj3.childrenMenuTreeNodeList==null){
											html+='<li><a href="#" url="'+obj3.linkAction+'" id="'+obj3.menuPrimeKey+'" menuseq="'+obj3.menuSeq+'">'+obj3.menuName+'</a>';
											html+='</li>';
										}else{
											html+='<li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown" url="'+obj2.linkAction+'" id="'+obj2.menuPrimeKey+'" menuseq="'+obj2.menuSeq+'">'+obj3.menuName+'</a>';
											html+='<ul class="dropdown-menu animated">';
											$(obj3.childrenMenuTreeNodeList).each(function(l,obj4){
												if(obj4.childrenMenuTreeNodeList==null){
													html+='<li><a href="#" url="'+obj4.linkAction+'" id="'+obj4.menuPrimeKey+'" menuseq="'+obj4.menuSeq+'">'+obj4.menuName+'</a>';
													html+='</li>';
												}else{
													
												}
											});
											html+='</ul>';
											html+='</li>';
										}
									});
								html+='</ul>';
								html+='</li>';
							}
						});
					}
				});
				
			$(".navbar-nav").append(html);	
			}
			
		});
	}
    	
    	
    </script>
    <script src="<%= request.getContextPath() %>/coframe/auth/skin2/js/bootsnav.js" type="text/javascript"></script>
    
</body>
</html>